<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Admin/LiveType/index')}">直播类型列表</a></li>
			<li><a href="{:U('Admin/LiveType/add')}">添加直播类型</a></li>
		</ul>
		<form class="well form-search" id="query_form" method="post" action="{:U('Admin/Video/index')}">
			视频种类： 
			<select class="select_2" name="category">
			    <option value="-1">全部</option>
				<option value="1" <if condition="$category eq 1"> selected </if>>普通</option>
				<option value="2" <if condition="$category eq 2"> selected </if>>VR</option>
			</select>
			<input type="button" name="query_form_btn" id="queryBtn" data-action="{:U('Admin/LiveType/index')}" class="btn btn-primary" value="查询" />
		</form>
		<form class="js-ajax-form" action="" method="post">
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>ID</th>
					<th>直播种类</th>
					<th>名称</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			    <php>
					 $category = array("1"=>'普通',"2"=>'VR');
				</php>
				<foreach name="data" item="vo">
				<tr>
					<td>{$vo.typeId}</td>
					<td>{$category[$vo['category']]}</td>
					<td>{$vo.name}</td>
					<td>
						<a href='{:U("Admin/LiveType/edit",array("typeId"=>$vo["typeId"], "name"=>$vo["name"], "category"=>$vo["category"]))}'>编辑</a>
						<a href='{:U("Admin/LiveType/delete",array("typeId"=>$vo["typeId"]))}' class="js-ajax-delete">删除</a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
	$(document).ready(function(){
		$('input[name="query_form_btn"]').click(function(){
			 $('#query_form').attr('action', $(this).attr('data-action'));
			 $('#query_form').submit();
		});
		
	});
	</script>
</body>
</html>